package com.xiumu.config.flyway;

import org.flywaydb.core.Flyway;
import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy;

/**
 * flyway 执行策略，先删除执行失败的记录，刷新flyway_schema_history，再增量执行sql语句
 * 该策略可以允许修改已经提交的sql文件。
 * 正式环境不能使用该策略, sql只能增量添加，不允许修改
 */
public class XiuMuFlywayMigrationStrategy implements FlywayMigrationStrategy {
    @Override
    public void migrate(Flyway flyway) {
        flyway.repair();
        flyway.migrate();
    }
}
